Extra YouTube Videos Plugin v1.1

\\\\\ THIS PLUGIN IS A MODIFICATION OF EXTRA_IMAGE PLUGIN MADE BY junglecoder (Ishmael Hall). I WOULD LIKE TO THANK JUNGLECODER!!! /////

This contribution will give you the ability to have multiple youtube videos per product.
The way this contribution works is very simple, it keeps extra YouTube URL videos in a new table in the database. Each product can have the 1 main image (in the products table) as well as an unlimited number of YouTube videos from the new extra_videos table. 

The admin interface allows you to add the URL of YouTube videos to each product in the database. There is a new item listed in the left column box under Catalog labeled Extra Videos. When adding videos, select the products model from the drop down menu, and enter the YouTube URL in the field provided.

This has been tested with osCommerce 2.2 MS2 and osCommerce 2.2 rc2a

If you have any problems please let me know.

Added files:
/admin/includes/languages/english/products_extra_videos.php
/admin/includes/languages/espanol/products_extra_videos.php
/admin/products_extra_videos.php
/catalog/includes/products_extra_videos.php

mySQL database modification:
Added 1 table to database

included extra_videos_english.sql or extra_videos_espanol.sql
--------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////////////

Installation:

Backup Backup Backup.
Make a backup of your files/database. This should go without saying, but I'll say it anyway, the changes in this contribution alter some original osc files.
Backup Backup Backup. 

Run the following SQL statement in whatever program you use to access your OSC database (?phpMyAdmin?) or if you have an option to run a *.sql file, I have included one that will accomplish the same thing so you can just run the included extra_videos.sql file, either way should work fine. 

DROP TABLE IF EXISTS products_extra_videos;
CREATE TABLE products_extra_videos (
  products_extra_videos_id int(11) NOT NULL auto_increment,
  products_id int(11) default NULL,
  products_extra_video varchar(64) default NULL,
  KEY products_extra_videos_id (products_extra_videos_id)
) TYPE=MyISAM;

=> English Version
INSERT INTO configuration VALUES ('', 'Display Extra videos (on products_info)', 'DISPLAY_EXTRA_VIDEOS', 'true', 'Display Extra videos', 1, 87, '1968-07-23 19:30:36', '1968-07-23 19:30:36', '', 'tep_cfg_select_option(array(\'false\', \'true\'),');

=> Spanish Version
INSERT INTO configuration VALUES ('', 'Mostrar videos extra (en products_info)', 'DISPLAY_EXTRA_VIDEOS', 'true', 'Mostrar videos', 1, 87, '1968-07-23 19:30:36', '1968-07-23 19:30:36', '', 'tep_cfg_select_option(array(\'false\', \'true\'),');


The changes needed to be made to the files of the osCommerce installation:

/admin/includes/filenames.php
(just before the last ?>)
define('FILENAME_PRODUCTS_EXTRA_VIDEOS','products_extra_videos.php'); //Extra YouTube Videos

/admin/includes/database_tables.php
(just before the last ?>)
define('TABLE_PRODUCTS_EXTRA_VIDEOS', 'products_extra_videos'); //Extra YouTube Videos
 
/admin/includes/boxes/catalog.php
Find the following line:
'<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES . '</a><br>' . 

and insert this line directly after it:
'<a href="' . tep_href_link(FILENAME_PRODUCTS_EXTRA_VIDEOS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS_EXTRA_VIDEOS . '</a><br>' . //Extra YouTube Videos

/admin/includes/languages/english.php
/admin/includes/languages/french.php
/admin/includes/languages/german.php
/admin/includes/languages/espanol.php
define('BOX_CATALOG_CATEGORIES_PRODUCTS_EXTRA_VIDEOS','Extra Videos'); //Extra YouTube Videos

/catalog/includes/database_tables.php
(just before the last ?>)
define('TABLE_PRODUCTS_EXTRA_VIDEOS', 'products_extra_videos'); //Extra YouTube Videos

/catalog/includes/languages/english.php
define('TEXT_EXTRA_VIDEOS', ' extra videos ');

/catalog/includes/languages/french.php
define('TEXT_EXTRA_VIDEOS', ' Videos Supplmentaires ');

/catalog/includes/languages/german.php
define('TEXT_EXTRA_VIDEOS', ' extra videos ');

/catalog/includes/languages/espanol.php
define('TEXT_EXTRA_VIDEOS', ' videos extra ');


/catalog/product_info.php
Find :
    
<?php
    } else {
?>
      <tr>
        <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td>
      </tr>
<?php
    }
	
After Add :
	if (DISPLAY_EXTRA_VIDEOS == 'true'){
     if ($product_check['total'] >= 1) {
       include (DIR_WS_INCLUDES . 'products_extra_videos.php');
     }
    } 

	
if you have the "extra_images" plugin, this must be the result:

<?php
    }
	
	if (DISPLAY_EXTRA_IMAGES == 'true'){
     if ($product_check['total'] >= 1) {
       include (DIR_WS_INCLUDES . 'products_extra_videos.php');
     }
    } 
	if (DISPLAY_EXTRA_VIDEOS == 'true'){
     if ($product_check['total'] >= 1) {
       include (DIR_WS_INCLUDES . 'products_extra_videos.php');
     }
    } 
	
?>

if not:

<?php
    }
	
	if (DISPLAY_EXTRA_VIDEOS == 'true'){
     if ($product_check['total'] >= 1) {
       include (DIR_WS_INCLUDES . 'products_extra_videos.php');
     }
    } 
	
?>


////////////////////////////////////////////////////////////////////////////////////////////

Backup your files and replace
	admin/products_extra_videos.php
and
	admin/includes/languages/xxxxx/products_extra_videos.php
